ROX-33198: Instrument inode tracking on file open lsm hook#391
Draft
JoukoVirtanen wants to merge 2 commits intomainfrom
Draft
ROX-33198: Instrument inode tracking on file open lsm hook#391JoukoVirtanen wants to merge 2 commits intomainfrom
JoukoVirtanen wants to merge 2 commits intomainfrom
Conversation
JoukoVirtanen
commented
Mar 15, 2026
| // to avoid verifier issues with untrusted pointers. | ||
| // We need to replicate the logic from inode_to_key() to handle | ||
| // special filesystems like btrfs correctly. | ||
| inode_key_t parent_key = {0}; |
Contributor
Author
There was a problem hiding this comment.
I tried to get the key for the parent using inode_to_key, but got a verifier error. That function is largely copied here. It is not completely copied, because doing so resulted in a verifier error. This will not work in all cases.
JoukoVirtanen
commented
Mar 15, 2026
| return Ok(()); | ||
| } | ||
|
|
||
| let host_path = host_info::prepend_host_mount(event.get_filename()); |
Contributor
Author
There was a problem hiding this comment.
The initial plan was to look up the parent, get its file path, and then add the file name. However, it seems possible to get the entire path from the event.
JoukoVirtanen
commented
Mar 15, 2026
| # Wait for creation event | ||
| process = Process.from_proc() | ||
| creation_event = Event(process=process, event_type=EventType.CREATION, | ||
| file=fut, host_path='') |
Contributor
Author
There was a problem hiding this comment.
Should host_path be populated here.
JoukoVirtanen
commented
Mar 15, 2026
| """ | ||
| cwd = os.getcwd() | ||
| config = { | ||
| 'paths': [f'{monitored_dir}/**', '/mounted/**', '/container-dir/**'], |
Contributor
Author
There was a problem hiding this comment.
I am not sure what globbing to use here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
A detailed explanation of the changes in your PR.
Feel free to remove this section if it is overkill for your PR, and the title of your PR is sufficiently descriptive.
Checklist
Automated testing
If any of these don't apply, please comment below.
Testing Performed
TODO(replace-me)
Use this space to explain how you tested your PR, or, if you didn't test it, why you did not do so. (Valid reasons include "CI is sufficient" or "No testable changes")
In addition to reviewing your code, reviewers must also review your testing instructions, and make sure they are sufficient.
For more details, ref the Confluence page about this section.